import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 殇
 * Date: 2025-07-31
 * Time: 9:01
 */
public class Test {
    public static void main(String[] args) {
        Integer[] arr=new Integer[]{1,2,3,4,5,};
        List<Integer> list=new ArrayList<>(Arrays.asList(arr));
        List<List<Integer>> ret=new ArrayList<>();
        ret.add(new ArrayList(list));
        System.out.println(list);
        System.out.println(ret);
        //-----------------------------------------
        list.remove(list.size()-1);
        System.out.println(list);
        System.out.println(ret);
    }
    public static void main1(String[] args) {
        Integer[] arr=new Integer[]{1,2,3,4,5,};
        List<Integer> list=new ArrayList<>(Arrays.asList(arr));
        List<List<Integer>> ret=new ArrayList<>();
        ret.add(list);
        //----------------------------------
        System.out.println(list);
        System.out.println(ret);
        //----------------------------------
        list.remove(list.size()-1);
        System.out.println(list);
        System.out.println(ret);
        //----------------------------------
        list.add(5);
        System.out.println(list);
        System.out.println(ret);
    }
}
